from django.db import models

# Create your models here.
class KData(models.Model):
    id = models.BigAutoField(primary_key=True, verbose_name="编号")
    trading_pair_id = models.ForeignKey(
        to="tradingPairs.TradingPairs",
        db_constraint=False,
        on_delete=models.CASCADE,
        verbose_name="交易对",
    )
    time = models.DateTimeField(verbose_name="时间")
    open = models.FloatField(verbose_name="开盘价")
    high = models.FloatField(verbose_name="最高价")
    low = models.FloatField(verbose_name="最低价")
    close = models.FloatField(verbose_name="收盘价")
    volume = models.FloatField(verbose_name="成交量")

    class Meta:
        db_table = "k_data"
        verbose_name = "K线数据"
        verbose_name_plural = verbose_name